package data;

import adapter.HTTPSiloAdapter;

public class Silo {

	private String name;
	private Double min;
	private Double max;
	private Double current;
	private String unit;
	private SiloState state = SiloState.NORMAL;
	private HTTPSiloAdapter adapter;

	public Silo(String name, Double min, Double max, String unit,
			HTTPSiloAdapter adapter) {
		this.name = name;
		this.min = min;
		this.max = max;
		this.unit = unit;
		this.adapter = adapter;

	}

	public double getFilling() {
		return this.current / (this.max / 100);
	}

	public String getSiloControllerAdress() {
		return this.adapter.getiNetAdress();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getMin() {
		return min;
	}

	public void setMin(Double min) {
		this.min = min;
	}

	public Double getMax() {
		return max;
	}

	public void setMax(Double max) {
		this.max = max;
	}

	public Double getCurrent() {
		return current;
	}

	public void setCurrent(Double current) {
		this.current = current;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public SiloState getState() {
		return state;
	}

	public void setState(SiloState state) {
		this.state = state;
	}

	public HTTPSiloAdapter getAdapter() {
		return adapter;
	}

	public void setAdapter(HTTPSiloAdapter adapter) {
		this.adapter = adapter;
	}

}
